forum

home / developersection / forums / how to print visualization as grayscale wpf?

How to Print visualization as grayscale WPF?

Anonymous User 2969 04-Nov-2014

How can I print a visual as grayscale without actually showing the PrintDialog, e.g.

PrintDialog dialog = new Dialog();
dialog.PrintQueue = new PrintQueue(new PrintServer(), printerNameAsString);
dialog.PrintTicket.InputBin = InputBin.AutoSelect;
// Further settings, e.g. PageMediaSize and scaling the visual.    

dialog.PrintVisual(myVisual, "myDescription");

Can I somehow get the PrinterDialog to print the visual in grayscale? Or is there a completely other way to achieve a grayscale printout of my visual?

Edit: myVisual (the Visual I want to print) is a Grid, so it inherits from UIElement. Edit 2: If possible I would prefer not to use any external libraries (because of company policies).


c# wpf 
Updated on 04-Nov-2014

I am a content writter !

Can you answer this question?

Answer

1 Answers

Liked By